package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCompanyDTO;
import com.nineclock.system.dto.SysUpdataCompanyDto;
import com.nineclock.system.pojo.SysCompany;
import com.nineclock.system.service.SysCompanyService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/company")
public class SysCompanyController {

    @Autowired
    private SysCompanyService sysCompanyService;


    @GetMapping
    public Result Company(){
        SysCompany sysCompany = sysCompanyService.CompanyMessage();
        return Result.success(sysCompany);
    }

    @PostMapping("/uploadOSS")
    public Result uploadOss(MultipartFile file){
        String upname = sysCompanyService.uploadOss(file);
        return Result.success(upname);
    }

    @PutMapping
    public Result updateCompany(@RequestBody SysUpdataCompanyDto dto){

        sysCompanyService.updateCompany(dto);
        return Result.success();
    }



}
